<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增【请填写功能名称】')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-leaverequest-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">驾驶员：</label>
                <div class="col-sm-8">
                    <select name="Name" class="form-control m-b" th:with="type=${@veDriversServiceImpl.getVeDriversList()}">
                        <option th:each="driver : ${type}" th:text="${driver.DriverName}" th:value="${driver.DriverID}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">驾驶员部门：</label>
                <div class="col-sm-8">
                    <input name="Department" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">驾驶员职位：</label>
                <div class="col-sm-8">
                    <input name="Position" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">请假日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="LeaveDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">请假类型：</label>
                <div class="col-sm-8">
                    <select name="LeaveType" class="form-control m-b"
                            th:with="type=${@dict.getType('sys_leave_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">请假时长：</label>
                <div class="col-sm-8">
                    <input name="LeaveDuration" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">请假事由：</label>
                <div class="col-sm-8">
                    <textarea name="LeaveReason" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">审批人：</label>
                <div class="col-sm-8">
                    <input name="Approver" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">审批状态：</label>
                <div class="col-sm-8">
                    <select name="ApprovalStatus" class="form-control m-b"
                            th:with="type=${@dict.getType('sys_leave_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">审批日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="ApprovalDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">是否需要替班：</label>
                <div class="col-sm-8">
                    <select name="Substitute" class="form-control m-b"
                            th:with="type=${@dict.getType('sys_leave_substitute')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">流程id：</label>
                <div class="col-sm-8">
                    <input name="Lid" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/leaverequest"

        $("#form-leaverequest-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-leaverequest-add').serialize());
            }
        }

        $("input[name='LeaveDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='ApprovalDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>